package esb.chapter10.filter;

import javax.jbi.messaging.MessageExchange;

import org.apache.servicemix.eip.support.Predicate;

/**
 * Simple configurable filter/predicate which we can use
 * to send a message to a detour flow, instead of to 
 * the normal message flow.
 * 
 * @author nl24167
 */
public class DetourFilter implements Predicate {

    private boolean enabled = true;
    
    public boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
    
    public boolean matches(MessageExchange arg0) {
        return enabled;
    }
}
